Skip to content

Update Part-1-Functions#4

Open
siddharth151199 wants to merge 1 commit into
Tushar-OP:masterfrom
siddharth151199:patch-2
Open

Update Part-1-Functions#4
siddharth151199 wants to merge 1 commit into
Tushar-OP:masterfrom
siddharth151199:patch-2

Conversation

@siddharth151199
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Owner

@Tushar-OP Tushar-OP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the changes

Comment thread Part-1-Functions
str="siddharth"
s=0
n=len(str)
for i in range(len(str)):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you use "n" variable if your not using it in range!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Comment thread Part-1-Functions
for i in range(len(str)):
print(str[s])
s=s+2

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you run the program? It's not correct, there's a possibility of index out of bounds error

Comment thread Part-1-Functions
if count_evens[i]%2==0:
count=count+1

return count
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Program's wrong

Comment thread Part-1-Functions
print("true")
else:
print("false")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The program is wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants